<?php

namespace App\Http\Requests\Api;

use Illuminate\Foundation\Http\FormRequest;

class VerificationCodeRequest extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'phone' => [
                'captcha_key'  => 'required|string',
                'captcha_code' => 'required|string',
            ]
        ];
    }

    public function messages()
    {
        return [
            'captcha_key.required'  => '图片验证码 key 不能为空',
            'captcha_code.required' => '图片验证码不能为空',
            'captcha_key.string'    => '图片验证码 key 格式不正确',
            'captcha_code.string'   => '图片验证码格式不正确',
        ];
    }
}
